package org.kamionowski.supreme.persistence.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Date;

/**
 * Created by IntelliJ IDEA.
 * User: Marcin Kamionowski
 * Date: 13.04.11
 * Time: 16:07
 */
@javax.persistence.Table(name = "search_filedsc", schema = "public", catalog = "")
@Entity
public class FileDsc implements Serializable{
    private Integer id;

    @javax.persistence.Column(name = "id", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    @Id
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    private String hostName;

    @javax.persistence.Column(name = "hostname", nullable = true, insertable = true, updatable = true, length = 255, precision = 0)
    @Basic
    public String getHostName() {
        return hostName;
    }

    public void setHostName(String host) {
        this.hostName = host;
    }

    private Boolean isactive;

    @javax.persistence.Column(name = "isactive", nullable = true, insertable = true, updatable = true, length = 1, precision = 0)
    @Basic
    public Boolean getIsactive() {
        return isactive;
    }

    public void setIsactive(Boolean isactive) {
        this.isactive = isactive;
    }

    private Integer type;

    @javax.persistence.Column(name = "type", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
    @Basic
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    private Date modificationDate;

    @javax.persistence.Column(name = "date_modification", nullable = true, insertable = true, updatable = true, length = 13, precision = 0)
    @Basic
    public Date getModificationDate() {
        return modificationDate;
    }

    public void setModificationDate(Date date) {
        this.modificationDate = date;
    }

    private String dir;

    @javax.persistence.Column(name = "dir", nullable = true, insertable = true, updatable = true, length = 400, precision = 0)
    @Basic
    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }

    private String name;

    @javax.persistence.Column(name = "name", nullable = true, insertable = true, updatable = true, length = 256, precision = 0)
    @Basic
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private Long fileSize;

    @javax.persistence.Column(name = "filesize", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long size) {
        this.fileSize = size;
    }

    private String ext;

    @javax.persistence.Column(name = "ext", nullable = true, insertable = true, updatable = true, length = 20, precision = 0)
    @Basic
    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FileDsc that = (FileDsc) o;

        if (dir != null ? !dir.equals(that.dir) : that.dir != null) return false;
        if (ext != null ? !ext.equals(that.ext) : that.ext != null) return false;
        if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (isactive != null ? !isactive.equals(that.isactive) : that.isactive != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (fileSize != null ? !fileSize.equals(that.fileSize) : that.fileSize != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = hostName != null ? hostName.hashCode() : 0;
        result = 31 * result + (isactive != null ? isactive.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (dir != null ? dir.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (fileSize != null ? fileSize.hashCode() : 0);
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (ext != null ? ext.hashCode() : 0);
        return result;
    }
}
